package com.cn.chaomeng.vo;

import com.cn.chaomeng.model.Food;
import com.cn.chaomeng.model.Orderfo;
import com.cn.chaomeng.utils.DateUtil;

import java.util.Date;

/**
 * @author LYJ
 *         Created by Administrator on 2018/3/7 0007.
 */
public class OrderfoVo {
    private Integer id;
    private Integer orderid;
    private Integer fid;
    private String foodName;
    private Double foodPrice;
    private Integer number;
    private String createTime;

    public OrderfoVo(Orderfo orderfo, Food food){
        this.id = orderfo.getId();
        this.orderid = orderfo.getOrderid();
        this.fid = orderfo.getFid();
        if(food != null){
            this.foodName = food.getFoodname();
            this.foodPrice = food.getFoodprice();
        }
        this.number = orderfo.getNumber();
        if(orderfo.getCreateTime() != null){
            this.createTime = DateUtil.getDateTimeFormat(new Date(Integer.parseInt(orderfo.getCreateTime())));
        }

    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getOrderid() {
        return orderid;
    }

    public void setOrderid(Integer orderid) {
        this.orderid = orderid;
    }

    public Integer getFid() {
        return fid;
    }

    public void setFid(Integer fid) {
        this.fid = fid;
    }

    public String getFoodName() {
        return foodName;
    }

    public void setFoodName(String foodName) {
        this.foodName = foodName;
    }

    public Double getFoodPrice() {
        return foodPrice;
    }

    public void setFoodPrice(Double foodPrice) {
        this.foodPrice = foodPrice;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
